define(function(require, exports, module) {
	"use strict";

	var baseService = require('Base_Service');
	// 控制器名
	exports.controller = "ExamBookings";

	/* 预约考试 */
	exports.add = function(data, success) {
		return baseService.post(
			baseService.getApiUrl(exports.controller, "Add"),
			data,
			function(retval) {
				success && success(retval);
			}
		);
	};
	
	/* 预约考试 */
	exports.retry = function(data, success) {
		return baseService.post(
			baseService.getApiUrl(exports.controller, "MakeupExam"),
			data,
			function(retval) {
				success && success(retval);
			}
		);
	};

	/* 预约考试记录 */
	exports.examList = function(currpage, pageSize, success) {
		var data = {
			pageIndex: currpage,
			pageSize: pageSize
		};
		return baseService.post(
			baseService.getApiUrl(exports.controller, "List"),
			data,
			function(retval) {
				success && success(retval);
			}
		);
	};

	/* 预约考试详情 */
	exports.getExamBooking = function(id, success) {
		var data = "id=" + id;
		return baseService.get(
			baseService.getApiUrl(exports.controller, "Detail"),
			data,
			function(retval) {
				success && success(retval);
			}
		);
	};
	
	exports.getExamBookingList = function(success){
		var data = {
			pageIndex: 0,
			pageSize: 10000
		}
		return baseService.post(
			baseService.getApiUrl(exports.controller, "NextList"),
			data,
			function(retval) {
				success && success(retval);
			}
		);
	}

	/* 取消 */
	exports.cancel = function(id, success) {
		return baseService.get(
			baseService.getApiUrl(exports.controller, "Cancel"),
			{id:id},
			function(retval) {
				success && success(retval);
			}
		);
	};

});